import req from '@/utils/request'
import type { LoginDataType, UserInfoDataType } from './model/LoginType'
enum Api {
  login = '/admin/acl/index/login',
  logout = '/admin/acl/index/logout',
  info = '/admin/acl/index/info',
}

export const loginApi = (username: string, password: string) => {
  return req.post<null, LoginDataType>(Api.login, { username, password })
}
export const logoutApi = () => {
  return req.post<null, null>(Api.logout)
}
export const userInfoApi = () => {
  return req.get<null, UserInfoDataType>(Api.info)
}
